﻿using kunukn.RecommendationEngine.AreaRecommendation.Code.Entities;

namespace kunukn.RecommendationEngine.AreaRecommendation.Code.Web
{
    /// <summary>
    /// Author: Kunuk Nykjaer    
    /// </summary>
    public class MyPage : System.Web.UI.Page
    {
        /// <summary>
        /// Remember current item, so it is accessable between the different user controls
        /// </summary>
        public Item CurrentItem
        {
            get { return ViewState["CurrentItem"] as Item; }
            protected set { ViewState["CurrentItem"] = value; }
        }

        public static Item GetCurrentItem(System.Web.UI.Page p)
        {
            return ((MyPage)p).CurrentItem;
        }
    }
}